/**
 * Copyright (c) 2013-2022 Nikita Koksharov
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.api.listener;

import java.util.EventListener;

/**
 * MessageListener 接口定义了消息监听器的基本行为。这个接口扩展了 EventListener 接口，
 * 为处理各种消息事件提供了一种通用的方式。该接口是泛型接口，允许监听器处理特定类型的消息。
 * @param <M> 消息类型参数，限定监听器处理的消息的类型。
 */
@FunctionalInterface
public interface MessageListener<M> extends EventListener {

    /**
     * 监听器接收到消息时需要执行的方法
     */
    void onMessage(CharSequence channel, M msg);

}
